Dial9 viewer#177
Merged
Merged
Conversation
Move index.html, trace_parser.js, test_parser.js, demo-trace.bin, and decode.js symlink from dial9-tokio-telemetry/trace_viewer/ to dial9-viewer/ui/ in preparation for the dial9-viewer crate. Update all references: netlify.toml, .gitignore, AGENTS.md, regenerate_demo_trace.sh, js_parser.rs, format_comparison.rs, README.md, and serve.py.
New crate: dial9-viewer — a CLI that serves the trace viewer UI and provides API endpoints for browsing S3 trace storage. - CLI with clap: --port, --bucket, --prefix, --ui-dir - Axum server serving static files from ui/ directory - StorageBackend trait (dyn-compatible) with S3Backend impl - GET /api/search?q=prefix&bucket=b — list objects by prefix - GET /api/trace?keys=k1,k2&bucket=b — fetch, gunzip, concat traces - Placeholder browser.html - serve.py for UI-only dev iteration - Integration tests for static file serving and API validation
- StorageBackend trait (dyn-compatible) for future pluggable backends - S3Backend: list_objects with pagination, get_object with error handling - GET /api/search: prefix-based S3 listing, supports default bucket/prefix - GET /api/trace: fetches multiple keys, gunzips, concatenates, 50MB cap - 9 integration tests including s3s-fs backed e2e tests - 583 stress iterations with zero failures
Self-contained HTML page (inline CSS/JS, no build step) with: - Bucket input and search prefix text box - Results table with checkbox multi-select - Select All / Deselect All buttons - "View Selected in Trace Viewer" opens index.html?trace=/api/trace?... - Pre-fills bucket/prefix from URL params - Dark theme matching the existing trace viewer
Exercises the complete browser flow against s3s-fs: 1. Upload gzipped trace segments 2. Search via /api/search 3. Build trace URL from search results (like browser.html does) 4. Fetch concatenated trace via /api/trace 5. Verify both segments present in output
a83a5ad to
0618e51
Compare
- dev-server: starts s3s fake S3, seeds with demo trace data, runs the viewer pointed at it. Useful for manual testing. - Fix: decompress demo-trace.bin before re-gzipping segments to avoid double-gzip that broke the viewer's JS decompression. - Add console.log tracing to the viewer's loadTraceFromUrl path for easier debugging of trace loading issues.
jlizen
approved these changes
Apr 9, 2026
jlizen
left a comment
Member
There was a problem hiding this comment.
good start, some nits, fine as follow ups
| .or(state.default_bucket.clone()) | ||
| .ok_or((StatusCode::BAD_REQUEST, "bucket is required".to_string()))?; | ||
|
|
||
| let keys: Vec<&str> = params.keys.split(',').filter(|k| !k.is_empty()).collect(); |
Member
There was a problem hiding this comment.
nit: commas are legal in s3 keys, consider multiple query params or a json array or something
|
|
||
| let mut combined = Vec::new(); | ||
|
|
||
| for key in &keys { |
Member
There was a problem hiding this comment.
nit: this is fetching sequentially, probably better to join_all them (or use transfer manager or something)
| } | ||
|
|
||
| #[derive(Debug)] | ||
| pub enum StorageError { |
Member
There was a problem hiding this comment.
nit: better to preserve source, or at least use DisplayErrorContext
| /// Dev helper: starts an s3s fake S3 server, seeds it with test trace data, | ||
| /// then starts the dial9-viewer pointed at it. | ||
| /// | ||
| /// Usage: cargo run -p dial9-viewer --bin dev-server |
Member
There was a problem hiding this comment.
nit: probably make port overrideable
rcoh
added a commit
that referenced
this pull request
Apr 9, 2026
- trace.rs: Use repeated query params (?keys=a&keys=b) instead of comma-separated, since commas are legal in S3 keys - trace.rs: Fetch S3 objects concurrently with join_all instead of sequentially - storage.rs: Use DisplayErrorContext for S3 errors to preserve the full error chain - dev_server.rs: Make port overrideable via PORT env var - Update browser.html, tests, and README to match new keys format
rcoh
added a commit
that referenced
this pull request
Apr 9, 2026
- trace.rs: Use repeated query params (?keys=a&keys=b) instead of comma-separated, since commas are legal in S3 keys - trace.rs: Fetch S3 objects concurrently with join_all instead of sequentially - storage.rs: Use DisplayErrorContext for S3 errors to preserve the full error chain - dev_server.rs: Make port overrideable via PORT env var - Update browser.html, tests, and README to match new keys format
- trace.rs: Use repeated query params (?keys=a&keys=b) instead of comma-separated, since commas are legal in S3 keys - trace.rs: Fetch S3 objects concurrently with join_all instead of sequentially - storage.rs: Use DisplayErrorContext for S3 errors to preserve the full error chain - dev_server.rs: Make port overrideable via PORT env var - Update browser.html, tests, and README to match new keys format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a minimal CLI tool that hosts a frontend / backend to allow serving files from S3 directly to the viewer. The UI is really minimal right now, I have a lot of plans to improve it but right now it just shows the files, offers a really basic search bar and lets you open the files in dial9.
